
#include <iostream>
#include "Adapter.hpp"
#include "Power.hpp"
#include "CNPower.hpp"
#include "USPower.hpp"
#include "SimpleConverter.hpp"
#include "CNPower.hpp"
#include "CN_ElectricalAppliance.hpp"
#include "US_ElectricalAppliance.hpp"

using namespace std;

int main()
{
    // 国标电源
    CNPower *cnPower = new CNPower();
    // 美标电源
    USPower *usPower = new USPower();
    // 国标用电器
    CN_ElectricalAppliance *cn_ElectricalAppliance = new CN_ElectricalAppliance();
    //美标用电器
    US_ElectricalAppliance *us_ElectricalAppliance = new US_ElectricalAppliance();

    cn_ElectricalAppliance->setPower(cnPower);
    cout << "国标电源启动国标电器：" << endl;
    cn_ElectricalAppliance->boot();

    us_ElectricalAppliance->setPower(usPower);
    cout << "美标电源启动美标电器：" << endl;
    cn_ElectricalAppliance->boot();

    us_ElectricalAppliance->setPower(cnPower);
    cout << "国标电源启动美标电器：" << endl;
    us_ElectricalAppliance->boot();

    cn_ElectricalAppliance->setPower(usPower);
    cout << "美标电源启动国标电器：" << endl;
    us_ElectricalAppliance->boot();

    SimpleConverter * simpleConverter = new SimpleConverter();
    simpleConverter->setInput(cnPower);
    us_ElectricalAppliance->setPower(simpleConverter);
    cout << "国标电源在转换器下，启动美标电器：" << endl;
    us_ElectricalAppliance->boot();
}
